/*
 *  Light.h
 *  GLRender
 *
 *  Created by Patrick zulian on 5/27/10.
 *  Copyright 2010 University  of Lugano. All rights reserved.
 *
 */

#ifndef LIGHT_H
#define LIGHT_H

#include "Base.h"
#include <QtOpenGL>
#include "WMaterial.h"


class Light  {
private:
	WMaterial mat;
	Point3d position;
	
	int lightNumber;
	
	std::map<GLenum, Point3d> params;
protected:

	
	static void initLights();
	
	Light(const WMaterial &mat, const Point3d &position, const int lightNumber);
	Light() { };
public:
	
	
	static Light * newLight(const WMaterial &mat, const Point3d &position);
	
	virtual
	~Light();
	
	inline
	void setPosition(Point3d &position) { this->position = position; }
	
	
	void setParam(GLenum key, const Point3d & value);
	
	const
	Point3d & getPosition() const { return this->position; }
	
	void set();
};


#endif
